<?php
/**
 * Created by PhpStorm.
 * UsersF: Mloong
 * Date: 2019/1/10
 * Time: 15:05
 */

namespace app\admin\controller;


use app\admin\service\LogService;
use think\Controller;
use think\facade\Request;
use app\admin\model\Admin;

class Log extends Controller
{
    public function index()
    {
        $username = Admin::getAllUser();
        $this->assign('username',$username);
        return $this->fetch('/log/log');
    }
    # 获取所有日志分页的接口
    public function getAllLogApi()
    {
        $data = Request::get();
        $service = new LogService($data);
        $log = $service->getAllLogPage($data);
        return json($log);
    }
    # 按条件查找日志的接口
    public function getLogByCondition()
    {
        $data = Request::get();
        $service = new LogService($data);
        $log = $service->byConditionGetLogData($data);
        return json($log);
    }
}